Palmdoc: minor leak fixes. (Needs more)
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sun, 23 Jan 2005 08:12:53 +0000 (08:12 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sun, 23 Jan 2005 08:12:53 +0000 (08:12 +0000)
Netstumbler: fix capaibilities
testo: add more tests.

gpsbabel/chkdoc
gpsbabel/netstumbler.c
gpsbabel/palmdoc.c
gpsbabel/testo

index b3a409b706d2e197b6a349586378bdc7992712a8..21a8eeb8b100d1aea1b4953fae672bf328d37833 100755 (executable)
@@ -16,11 +16,17 @@ checkit() {
                ECODE=1
        fi
        
-       if ! grep -qi "^    $TYPE$" README 
+       if ! grep -qi "^    $TYPE$" ~/src/babelweb/README 
        then
                echo $STY $TYPE is not documented in README.
                ECODE=1
        fi
+
+       if ! grep -qi "$TYPE" testo
+       then
+               echo $STY $TYPE is not in testo.
+               ECODE=1
+       fi
 }
 
 ./gpsbabel -^ |
index 5c5489d3687d6de829e5f44f87d02388cd358bbe..242fdb8815a2c1575f486a6b01f3f0511c2a901b 100644 (file)
@@ -293,7 +293,7 @@ fix_netstumbler_dupes(void)
 
 ff_vecs_t netstumbler_vecs = {
        ff_type_file,
-       { ff_cap_write, ff_cap_none, ff_cap_none },
+       { ff_cap_read, ff_cap_none, ff_cap_none },
        rd_init,
        NULL,
        rd_deinit,
index 578c21aac66c1a591bfa7d15b875b38cd63e3a65..32344c821e3d3dab33e6a2a30b4aa67ba3757e67 100644 (file)
@@ -265,6 +265,7 @@ static void write_header( void ) {
        if (pdb_InsertRecord(opdb, NULL, opdb_rec)) {
                fatal(MYNAME ": libpdb couldn't insert summary record\n");
        }
+       xfree(rec0);
 }
 
 static void write_bookmarks( void ) {
@@ -302,7 +303,6 @@ static void write_bookmarks( void ) {
                        fatal(MYNAME ": libpdb couldn't append bookmark record\n");
                }
 
-               
                xfree( oldmark );
        } 
 }
@@ -417,20 +417,24 @@ palmdoc_disp(const waypoint *wpt)
        long utmz;
        double utme, utmn;
        char utmzc;
+       char *bm;
 
         char bookmarktext[17];
 
         if ( bmid ) {
+               char * s = mkshort(mkshort_bookmark_handle, wpt->description);
                sprintf( bookmarktext, "%6s:%9s", 
-                       wpt->shortname?wpt->shortname:"",
-                       mkshort(mkshort_bookmark_handle, wpt->description));
+                       wpt->shortname?wpt->shortname:"",s);
+               xfree(s);
        }
        else {
-               sprintf( bookmarktext, "%16s", 
-                       mkshort(mkshort_bookmark_handle, wpt->description));
+               char * s = mkshort(mkshort_bookmark_handle, wpt->description);
+               sprintf( bookmarktext, "%16s", s);
+               xfree(s);
        }       
-       
-        create_bookmark(xstrdup(bookmarktext)); 
+
+        bm = xstrdup(bookmarktext); 
+        create_bookmark(bm);
        
        lonint = abs(wpt->longitude);
        latint = abs(wpt->latitude);
index 37a35d2deadf0a0bbfdd50b91d589c88e3337dbc..259f4d3e8ee37d337b22626575a49822f72ead7a 100755 (executable)
@@ -156,7 +156,7 @@ compare ${TMPDIR}/ozi.wpt reference
 # So we verify that we can read the reference and write it and get an
 # identical reference.
 ${PNAME} -i holux -f reference/paris.wpo -o holux -F ${TMPDIR}/paris.wpo
-compare reference/paris.wpo ${TMPDIR}/paris.wpo
+compare reference/paris.wpo ${TMPDIR}/paris.wpo
 
 # Magellan NAV Companion for PalmOS
 # This format is hard to test, because each record and the database itself
@@ -608,4 +608,25 @@ ${PNAME} -i hsandv -f reference/Glad_4.exp -o hsandv -F ${TMPDIR}/Glad_5.exp
 
 ${PNAME} -i geo -f geocaching.loc -x stack,push,copy,nowarn -x stack,push,copy -x stack,push -x stack,pop,replace -x stack,pop,append -x stack,push,copy -x stack,pop,discard -x stack,swap,depth=1 -o arc -F ${TMPDIR}/stackfilt.txt
 
+#
+# 'tabsep' isn't really tested in any non-trivial way, but we do exercise
+# it.
+#
+
+${PNAME} -i geo -f geocaching.loc  -o tabsep -F - | ${PNAME} -i tabsep -f - -o geo -F ${TMPDIR}/tabsep.out
+${PNAME} -i geo -f geocaching.loc  -o geo -F ${TMPDIR}/geotabsep.out
+
+# 
+# Now do the same for custom - it has the same issues.
+#
+
+compare ${TMPDIR}/tabsep.out ${TMPDIR}/geotabsep.out
+${PNAME} -i geo -f geocaching.loc  -o custom -F - | ${PNAME} -i custom -f - -o geo -F ${TMPDIR}/custom.out
+${PNAME} -i geo -f geocaching.loc  -o geo -F ${TMPDIR}/geocustom.out
+
+#
+# Write something to the various output-only formats
+#
+${PNAME} -i geo -f geocaching.loc -o text -F ${TMPDIR}/text.out -o html -F ${TMPDIR}/html.out -o vcard -F ${TMPDIR}/vcard.out #-o palmdoc -F ${TMPDIR}/pd.out
+
 exit 0